/*
 * Copyright 2013 Kenneth Syharath
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the license at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the license is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the license for specific language governing
 * permissions and limitations under the license.
 */

package test_output;

import java.util.List;

import randomness_measurement.ShiftMeasurements;
import shuffler_classes.Shufflers;

import com.google.common.collect.Lists;

public class ShiftMeasureOutput {
	@SuppressWarnings({ "unchecked", "rawtypes" })
	public static void main(String args[]) {
		System.out.println("Starting Shift Measurement Output");
		List startList = Lists.newArrayList();
		double shift;
		
		for (int i = 1; i <= 30; i++)
			startList.add(i);
		
		System.out.println("Start List");
		for (Object obj : startList)
			System.out.print(obj + ", ");
		System.out.println();
		
		System.out.println("Expected Shift: " + ShiftMeasurements.calcExpectedShift(startList));
		
		List endList = Shufflers.mongeanShuffle(startList);
		shift = ShiftMeasurements.measureOverallShift(startList, endList);
		System.out.println("Mongean Shift: " + shift);
		
		endList = Shufflers.riffleShuffle(startList, 2, true);
		shift = ShiftMeasurements.measureOverallShift(startList, endList);
		System.out.println("Riffle Shift: " + shift);
		
		endList = Shufflers.fisherYatesShuffle(Lists.newArrayList(startList));
		shift = ShiftMeasurements.measureOverallShift(startList, endList);
		System.out.println("Fisher-Yates Shift: " + shift);
	}
}
